
#ifndef VANTIDEL_CPP_OBJSTRING_H
#define VANTIDEL_CPP_OBJSTRING_H

#include "ObjHeader.h"

class ObjString {
public:
    ObjHeader objHeader;
    uint32_t hashCode;  //字符串的哈希值
    CharValue value{};

    static uint32_t HashString(const char *str, uint32_t length);

    static void HashObjString(ObjString *objString);

    static ObjString *NewObjString(VM *vm, const char *str, uint32_t length);

    ObjString(VM *vm, const char *str, uint32_t length);
};


#endif //VANTIDEL_CPP_OBJSTRING_H
